<%# The license inside this block applies to this file.
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
<% autogen_exception -%>
<% resource_underscored_name = plural ? resource_name(object, product).pluralize : resource_name(object, product) -%>
---
title: About the <%= resource_underscored_name -%> resource
platform: gcp
---

## Syntax
A `<%= resource_underscored_name -%>` is used to test a Google <%= object.name -%> resource

<% if beta?(object) -%>

## Beta Resource
This resource has beta fields available. To retrieve these fields, include `beta: true` in the constructor for the resource

<% end -%>
## Examples
```
<%= compile(pwd + "/templates/inspec/examples/#{resource_name(object, product)}/#{resource_underscored_name}.erb") -%>

```
<% if object.singular_extra_examples && !plural -%>

<%= compile(pwd + '/' + object.singular_extra_examples) -%>

<% end -%>
<% if object.plural_extra_examples && plural -%>

<%= compile(pwd + '/' + object.plural_extra_examples) -%>

<% end -%>

## Properties
Properties that can be accessed from the `<%= resource_underscored_name -%>` resource:

<% if plural -%>
See <%= "[#{resource_name(object, product)}.md](#{resource_name(object, product)}.md)" -%> for more detailed information
<% object.all_user_properties.reject(&:exclude_plural).each do |prop| -%>
  * `<%= "#{(prop.override_name || prop.out_name).pluralize}" -%>`: <% if prop.min_version.name == 'beta' -%><%= '(Beta only) ' -%><% end -%>an array of `<%= resource_name(object, product) -%>` <%= "#{prop.out_name}" -%>

<% end -%>

## Filter Criteria
This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.
<% else # if plural -%>
<% object.all_user_properties.each do |prop| -%>

<%= markdown_format(prop) -%>

<% end -%>

<% end # if plural -%>
<% unless @api.apis_required&.empty? -%>

## GCP Permissions

<% @api.apis_required&.each do |api| -%>
Ensure the [<%= api.name -%>](<%= api.url -%>) is enabled for the current project.
<% end # @api.apis_required.each -%>
<% end # unless @api.apis_required.empty? -%>